package com.game.commons.configuration.transformers;

import java.lang.reflect.Field;

import com.game.commons.configuration.PropertyTransformer;
import com.game.commons.configuration.TransformationException;

/**
 * 字符串转换成短整形
 * @author 杜祥
 * @create 2013-6-29
 */
public class ShortTransformer implements PropertyTransformer<Short>
{


	public static final ShortTransformer	SHARED_INSTANCE	= new ShortTransformer();



	@Override
	public Short transform(String value, Field field) throws TransformationException
	{
		try
		{
			return Short.decode(value);
		}
		catch(Exception e)
		{
			throw new TransformationException(e);
		}
	}
}
